# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: Jim Ferguson <ferguson@ncsa.uiuc.edu>
# Contributor: Xi0N <jonandermonleon@gmail.com>
# Contributor: goll <adrian.goll+aur[at]gmail>

pkgname=iperf3
pkgver=3.15
pkgrel=1
pkgdesc='TCP, UDP, and SCTP network bandwidth measurement tool'
url='https://github.com/esnet/iperf'
arch=('loong64' 'x86_64')
license=('BSD')
depends=('glibc' 'openssl' 'lksctp-tools')
provides=('libiperf.so')
source=(https://downloads.es.net/pub/iperf/iperf-${pkgver}.tar.gz)
sha512sums=('988bc558f40a16c3d94df3956705712829c1c529efd577db16213783846c84bc3edbad19a4d7890b7aba08fbc4e1c6807105df29931e9b45981066b609d87aa2')
b2sums=('f086d506d1de8e8b333a7ad46a94279aa5b42800ded7cc6724c3400e479a6523b336c74b5956d07117a178b5f89934553535824a05daafcdb2eb8d31754680e1')

build() {
  cd iperf-${pkgver}
  ./configure --prefix=/usr
  make
}

check() {
  cd iperf-${pkgver}
  make check
}

package() {
  cd iperf-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 examples/*{.am,.in,.c} -t "${pkgdir}/usr/share/doc/${pkgname}/examples"
  install -Dm 644 contrib/iperf3.service -t "${pkgdir}/usr/lib/systemd/system"
}

# vim: ts=2 sw=2 et:
